	<div id="select_incident">
		<% form_tag({:action => 'show'}, {:method => 'get'}) do %>
			 <label for="ordinateur">Ordinateur à étudier : </label>
			 	
			 <%= select("machine_selection", "machine_id", Machine.all.collect {|m| [m.machine_name, m.id]}, {:index => nil}) %>
	         <br /><br />
			 <label for="debut">Date de début de l'étude (AAAA-MM-JJ) : </label>
			 <input type="date" required="required" name="start" value="2011-01-01"><br /><br />
			 <label for="fin">Date de fin de l'étude (AAAA-MM-JJ) (Exclus): </label>
			 <input type="date" required="required" name="end" value="<%= Date.current %>"><br /><br />
			 <input type="submit" value="Voir l'historique du pc" />
		<% end %>
	</div>
	
	<table class="table">
	  <tr>
	    <th>N°</th>
	    <th>Nom machine</th>
		<th>Type incident</th>
		<th>RAM use</th>
		<th>Total RAM</th>
		<th>% RAM utilisé </th>
		<th>Espace disque use</th>
		<th>Total space disque</th>
		<th>%espace disque use </th>
		<th>Date incident </th>
		<th>Date résolution </th>
		<th>Résoudre le problème</th>
		<th>Résoudre le type de problème</th>
	  </tr>
	
	<% @Incidents.each do |incident| %>
		  <% type_machine = incident.incident_type %>
		  <tr>
		    <td><%=h incident.id %></td>
		    <td><%=h incident.machine.machine_name %></td>
			<td><%=h incident.incident_type %></td>
			<% if(type_machine == "Host unreachable") %>
				<td>---</td>
				<td>---</td>
				<td>---</td>
				<td>---</td>
				<td>---</td>
				<td>---</td>
			<% else %>
				<td><%=h incident.ram_use %></td>
				<td><%=h incident.ram_total %></td>
				<td><%=h incident.ram_percent %></td>
				<td><%=h incident.disk_use %></td>
				<td><%=h incident.disk_total %></td>
				<td><%=h incident.disk_percent %></td>
			<% end %>
			<td><%=h date_from_db(incident.created_at) %></td>
			<% if incident.resolution_date == nil %>
				<td><%= date_from_db(incident.resolution_date) %></td>
				<td><%= link_to image_tag("tools.png"), :action => "closeIncident", :id => incident.id %></td>
				<td><%= link_to image_tag("setting_tools.png"), :action => "closeAllIncident", :id => incident.id %></td>
			<% else %>
				<td><%= date_from_db(incident.resolution_date) %></td>
				<td>incident clôturé</td>
				<td>incident clôturé</td>
			<% end %>
		  </tr>
	<% end %>
	</table>
	<div class="flickr_pagination">
    	<span><%= will_paginate @Incidents, :container => false %></span>
  	</div>
	

			